package leecode

import "strings"

func countSubstrings(s string, c byte) int64 {
	//统计字符串中c的数量
	count := strings.Count(s, string(c))
	result := (1 + count) * count / 2
	return int64(result)
}
